package com.vincent.kdp.js;

import android.app.Activity;
import android.util.Log;
import android.webkit.JavascriptInterface;

import com.vincent.kdp.ui.commodity.repository.CommodityDetailRepository;
import com.vincent.kdp.util.BaseParam;

/**
 * Created by Administrator on 2017/5/12 0012.
 */

public class QualityOperator {

    private Activity activity;
    private String name;
    private String url;
    private CommodityDetailRepository repository=new CommodityDetailRepository();

    public QualityOperator(Activity activity, String url) {
        this.activity = activity;
        this.url=url;
    }

    @JavascriptInterface
    public String getDeviceId(){
        return BaseParam.getDeviceId();
    }
    @JavascriptInterface
    public String getUrl(){
        return url;
    }

//    @JavascriptInterface
//    public void getWebId(final String message,final String url){
//        activity.runOnUiThread(new Runnable() {
//            @Override
//            public void run() {
//                Log.i("code",message);
//                if("请求成功".equals(message)){
//                    Toast.makeText(activity, url, Toast.LENGTH_SHORT).show();
////                    Intent intent =new Intent(activity, AddConsumeActivity.class);
////
////                    intent.putExtra("barCode", barCode);
////                    intent.putExtra("url", url);
////                    Log.d("AddConsumeActivity",name+"----"+barCode+"----"+url);
////                    activity.startActivity(intent);
//                    activity.finish();
//                }
//            }
//        });

//    }
}
